package com.tian.core.utils;

import com.alibaba.fastjson.JSONObject;


public class FastJsonUtils {
    /**
     * 对象转json字符串
     * @param object
     * @return
     */
    public static String object2Json(Object object){
        return  JSONObject.toJSONString(object);
    }

    /**
     * json转对象
     * @param json
     * @param aClass
     * @param <T>
     * @return
     */
    public static <T> T json2Objct(String json,Class<T> aClass) {
        return JSONObject.parseObject(json,aClass);
    }
}
